﻿using System;
using System.Windows.Forms;

namespace LocalSend2 {
	internal partial class DownloadMask : UserControl {
		public DownloadMask(string fileName, string savePath, string fileSize) {
			InitializeComponent();

			lblFileName.Text = fileName;
			lblSavePath.Text = savePath;
			lblFileSize.Text = fileSize;
		}

		/// <summary>
		/// 设置下载速度
		/// </summary>
		/// <param name="speedStr">下载速度显示字符串</param>
		public void SetDownloadSpeed(string speedStr) {
			BeginInvoke(new Action(() => { lblSpeed.Text = speedStr; }));
		}

		/// <summary>
		/// 更新进度条
		/// </summary>
		/// <param name="val">完成进度，0 ~ 100</param>
		public void SetProgress(int val) {
			BeginInvoke(new Action(() => { progressBar1.Value = val; }));
		}
	}
}
